package com.help10000.rms.mvp.presenter

import com.amir.common.api.CustomObserver
import com.amir.common.beans.GatheringInfoEntity
import com.amir.common.mvp.model.Model
import com.amir.common.mvp.presenter.BasePresenter
import com.amir.common.utils.Constant
import com.amir.common.utils.SPUtils
import com.help10000.rms.mvp.view.GatheringView

class GatheringPresenter(view: GatheringView) : BasePresenter<GatheringView>(view) {

    /**
     * 收款
     */
    fun gathingData(repairId: String?) {
        val AccessToken = SPUtils.getString(Constant.AccessToken)
        val payInit = Model.getServer().PayInit(AccessToken, repairId)
        Model.getObservable(payInit, object : CustomObserver<GatheringInfoEntity>(mvpView) {

            override fun success(t: GatheringInfoEntity) {
                mvpView?.infoSuccess(t.data)
            }
        })
    }


}